//
//  ReadBlueTool.h
//  WoChuangFu
//
//  Created by 陈贵邦 on 15/7/7.
//  Copyright (c) 2015年 asiainfo-linkage. All rights reserved.
//

#import <Foundation/Foundation.h>


typedef void (^SearchBlueToolBlock)(NSArray *arry);;
typedef void (^ConnectResultBlock)(BOOL isConnected);
typedef void (^GetCertInfoBlock)(NSDictionary *dic);
typedef void (^CheckCardBlock)(BOOL checkCode); // 
typedef void (^WriteCardBlock)(int writeCode); //1为成功  其他失败
typedef void (^ReadICCIDBlock)(NSString* readString);

typedef void(^ChooseBlueToolBlock)(NSDictionary *dic);

@interface CardReaderManager : NSObject


/*
 在Viewdidload里实例化
 */
+(CardReaderManager*)shareTool;






/*
 搜索蓝牙并弹出提示框
 */
-(void)searchBlueTool:(SearchBlueToolBlock)searchBlueToolBlock ChooseBlueToolBlock:(ChooseBlueToolBlock)chooseBlueToolBlock ConnectResult:(ConnectResultBlock)connectRs;
//-(void)connectToBlueTool:(ConnectToBlueToolsBlock)connectResultBlock blueToolDic:(NSDictionary*)toolDic;

/*
 获取身份证信息
 */
-(void)getCertInfo:(GetCertInfoBlock)messageBlock isShowImage:(BOOL)isShow;


/*
 检查白卡
 */
-(void)checkCard:(CheckCardBlock)checkCardBlock;


/*
 读取iccid
 */
-(void)readIccid:(ReadICCIDBlock)readiccidBlock;

/*
 写卡
 */
-(void)writeCard:(WriteCardBlock)writeCardBlock imsi:(NSString*)imsi sms:(NSString*)sms num:(NSString *)num;

/*
    获取当前蓝牙设备
 */
-(NSDictionary*)getUsingBlueToolDic;

/*
 断开所有蓝牙
 */
+(void)destroyAllTools;



-(void)testSRwriteMSM;

//@property(nonatomic,copy) SearchBlueToolBlock searchBlueToolBlock;  //搜索蓝牙block
//@property(nonatomic,copy) ConnectToBlueToolsBlock connectToBlueToolsBlock; //连接蓝牙block
//@property(nonatomic,copy) GetCertInfoBlock getCertInfoBlock; //读身份证block
//@property(nonatomic,copy) CheckCardBlock checkCardBlock; //检查白卡block
//@property(nonatomic,copy) WriteCardBlock writeCardBlock; //检查白卡block

//当前蓝牙连接状态
-(BOOL)currentToolConnectStat;

-(void)SRtoolRefreshTools;
@end
